<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"></html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv=X-UA-Compatible content="IE=edge">
    <meta name=format-detection content="telephone=no">
    <meta name=format-detection content="email=no">
    <meta name=apple-mobile-web-app-capable content=yes>
    <meta name=apple-mobile-web-app-status-bar-style content=black>
    <meta name=full-screen content=yes><meta name=browsermode content=application>
    <meta name=x5-orientation content=portrait><meta name=x5-fullscreen content=true>
    <meta name=x5-page-mode content=app>
    <meta name=viewport content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">

    <title>店铺预览</title>
    <script th:src="@{/wap/js/vue.min.js}"></script>
    <script th:src="@{/wap/js/axios.min.js}"></script>
    <script th:src="@{/wap/js/index.js}"></script>
    <link rel="stylesheet" th:href="@{/wap/css/store.css}">
</head>
<body>
<div id="content" >
    <header class="share-head">
        <img th:src="@{/wap/img/ico-3.png}" alt="">
    </header>
    <section class="share-main">
        <div class="share-logo clear">
            <img :src="contents.logo" alt="">
            <div class="share-logo-text">
                <p>店铺名称: {{contents.name}}</p>
                <p>店铺地址: {{contents.address}}</p>
            </div>
            <span class="share-logo-map" @click="shareMap(contents)"><span></span>一键导航</span>
        </div>
        <span class="share-cp-zz"></span>
        <ul class="share-cp clear">
            <li class="share-list" v-for="item in contents.storeProductResultList">
                <img :src="item.mainImage" alt="">
                <p class="share-list-name">{{item.name}}</p>
            </li>
        </ul>
    </section>
    <footer class="share-foot">
	    <a :href="tel">
			<span>联系商家</span>
        </a>
    </footer>
</div>
<script th:inline="javascript">
    var baseUrl = [[${baseUrl}]];
    console.log(baseUrl);
</script>
<script th:src="@{/wap/js/jquery-2.1.1.js}"></script>
<script th:inline="javascript">
    var app = new Vue({
        el: '#content',
        data: {
            contents: {},
			tel: '',
        },
        methods: {
            /*页面数据获取*/
            getNew: function () {
                var zxc = this;
                axios.post(baseUrl + 'dealer/wap/app/store/info/' + GetQueryString('id'), {
                }).then(function (response) {
                    console.log(response)
                    zxc.contents = response.data.data;
                    zxc.tel = 'tel:' + response.data.data.phone
                }).catch(function (error) {
                    console.log(error);
                });

            },
            shareMap: function (val) {
                location.href="/dealer/wap/map.html?longitude=" + val.longitude + "&latitude="  + val.latitude+ "&name="  + val.name + "&address="  + val.address
            }
        },
        created: function (){
            this.getNew();
        }
    });
</script>
</body>
</html>
